﻿using ePlanet.ArchiveBorrow.Services;
using ePlanet.ArchiveBorrow.Models;
using Microsoft.Practices.Unity;
using System;

namespace Web.Views.ArchiveBorrow.ArchiveBorrowView
{
    public class ArchiveBorrowViewBase : PageBase
    {
        [Dependency]
        public IArchiveBorrowService m_IArchiveBorrowService
        {
            get;
            set;
        }

        protected ArchiveBorrowModel.ARCHIVEBORROWRow m_CurrentArchiveBorrowModel = null;

        protected void InitArchiveBorrowModel(Guid dataID)
        {
            ArchiveBorrowModel model = this.m_IArchiveBorrowService.GetSingleArchiveBorrowModelByDataID(dataID);
            if (model != null && model.ARCHIVEBORROW.Count > 0)
            {
                this.m_CurrentArchiveBorrowModel = model.ARCHIVEBORROW[0];
            }
        }
    }
}